<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
    <head>
        <title>修改</title>
    </head>
    <body>
        <h3>修改用户</h3>
        <p>${ message }</p>
        <% session.removeAttribute( "message" ); %>
        <form action="/customer/edit" method="post">
            <!-- 使用隐藏表单域传递 id  -->
            <input type="hidden" name="id" value="${ customer.id }">
            <div class="row">
                <input type="text" name="username" value="${ customer.username }" placeholder="用户名">
                <% session.removeAttribute( "username" ); %>
            </div>
            <div class="row">
                <input type="password" name="password" placeholder="密码">
            </div>
            <div class="row">
                <input type="password" name="confirm" placeholder="确认密码">
            </div>
            <div class="row">
                <input type="text" name="nickname" value="${ customer.nickname }" placeholder="昵称">
                <% session.removeAttribute( "nickname" ); %>
            </div>
            <div class="row">
                <input type="text" name="name" value="${ customer.name }" placeholder="真实姓名">
                <% session.removeAttribute( "name" ); %>
            </div>
            <div class="row">
                <input type="radio" name="gender" value="male" ${ customer.gender == 'male' ? 'checked' : '' } >男
                <input type="radio" name="gender" value="female" ${ customer.gender == 'female' ? 'checked' : '' } >女
                <% session.removeAttribute( "gender" ); %>
            </div>
            <div class="row">
                <input type="date" name="birthdate" value="${ customer.birthdate }">
            </div>
            <div class="row">
                <button type="submit">重置</button>
                <button type="submit">修改</button>
            </div>
        </form>
    </body>
</html>
